const cookie = {
    set(name, value, days) {
        let d = new Date();
        d.setDate(d.getDate() + days);
        document.cookie = `${name}=${value};expires=${d};path=/`;
    },
    get(name) {
        let arr = document.cookie.split("; ");
        for (let value of arr) {
            let newarr = value.split("=");
            if (name === newarr[0]) {
                return newarr[1];
            }
        }
    },
    remove(name) {
        this.set(name, "", -1);
    },
};

export {
    cookie
}